<?php
/**
 * Created by PhpStorm.
 * User: fengzi
 * Date: 2019/6/3
 * Time: 11:29
 */

namespace app\vehicle\controller;
use think\Controller;
use service\UtilService;
use service\JsonService;
use think\facade\Request;
use think\Db;
class Hotel extends Controller{

    public function index(){
        $data_ip = 'localhost';
        $data_user = 'posapp2003';
        $data_num = '3306';
        $data_pwd = 'posapp2003';
        $data_name = 'posapp2003';
        $this->model = Db::connect('mysql://'.$data_user.':'.$data_pwd.'@'.$data_ip.':'.$data_num.'/'.$data_name.'#utf8');
        if($_REQUEST['id']){
            $query ="select * from poscust where CustID=".$_REQUEST['id'];
            $hotel =  $this->model->query($query);
            exit(json_encode($hotel[0]));
        }
    }


}
